# coding=utf-8
from django.db import models
'''
python manage.py makemigrations study
python manage.py migrate study
'''
class users(models.Model):
	id = models.IntegerField(primary_key=True)
	name = models.CharField(max_length=16, verbose_name="姓名", null=False, blank=False)
	tel = models.IntegerField(verbose_name="手机号", null=False, blank=False)
	addr = models.CharField(max_length=80, verbose_name="地址", null=True, blank=True)
	age = models.IntegerField(verbose_name="年龄", null=True, blank=True)

	class Meta:
		app_label = 'study'

	def to_dict(self):
		return dict([(attr.name, str(getattr(self, attr.name))) for attr in self._meta.fields])
